package com.tony.thread;

public class NoShareThreadData extends Thread {
    public NoShareThreadData(String name){
        this.setName(name);
    }
    private int a = 3;
    @Override
    public void run() {
        while(a>0){
            a--;
            System.out.println(Thread.currentThread().getName()+"计算结果："+a);
        }
    }

    public static void main(String[] args) {
        NoShareThreadData nstd1 = new NoShareThreadData("t1");
        NoShareThreadData nstd2 = new NoShareThreadData("t2");
        NoShareThreadData nstd3 = new NoShareThreadData("t3");
        nstd1.start();
        nstd2.start();
        nstd3.start();
    }
}
